package org.dey.controller;


import org.dey.entity.Result;
import org.dey.pojo.*;
import org.dey.service.FormulateSchemeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author hg
 * @date 2022/3/31
 * @classname
 */
@RestController
public class FormulateSchemeController {

    @Autowired
    FormulateSchemeService formulateSchemeService;


    //全部运动库数据
    @GetMapping("exerciseqb.do")
    public List<Exercise> exerciseqb(){
       List<Exercise> list = formulateSchemeService.exerciseqb();
        return list;
    }

    //全部膳食库数据
    @GetMapping("dietaryqb.do")
    public List<Dietary> dietaryqb(){
        List<Dietary> list = formulateSchemeService.dietaryqb();
        return list;
    }

    @PostMapping("addganyu.do/{rqid}")
    public Result addganyu(@PathVariable int rqid,@RequestBody InterveneTemplate interveneTemplate){

      Result result =  formulateSchemeService.addganyu(rqid,interveneTemplate);

      return result;

    }

    //干预 制定方案页面会员数据
    @GetMapping("memberXx.action/{pageNum}/{pagesize}")
    public PageVo<Member> memberXx(@PathVariable int pageNum,@PathVariable int pagesize){

        PageVo<Member> list =  formulateSchemeService.memberXx(pageNum,pagesize);

        return list;

    }



}
